package huiji;

import java.awt.image.BufferedImage;

public class HuijiImage {
    //元素图片
    BufferedImage image;
    //宽度
    int width;
    //高度
    int height;

    public BufferedImage getImage() {
        return image;
    }

    public HuijiImage setImage(BufferedImage image) {
        this.image = image;
        return this;
    }

    /**
     * 设置图片同时设置宽高
     * @param image
     * @return
     */
    public HuijiImage setImageAndWH(BufferedImage image) {
        this.image = image;
        this.width = this.image.getWidth();
        this.height = this.image.getHeight();
        return this;
    }

    public int getWidth() {
        return width;
    }

    public HuijiImage setWidth(int width) {
        this.width = width;
        return this;
    }

    public int getHeight() {
        return height;
    }

    public HuijiImage setHeight(int height) {
        this.height = height;
        return this;
    }
}
